import {getInfo, setInfo,removeInfo} from '@/utils/storage'

  

export default {
    namespaced: true,
    state(){
        return {
            //个人权证相关
            userInfo:getInfo()
        }
    },
    mutations:{
        //所有mutations的第一个参数都是state
        setUserInfo(state, obj){
            state.userInfo = obj
            setInfo(obj)
        },
        removeUserInfo(state){
            const userDefault = {
                token:'',
                userId:'',
                roleId:'',
                storeId:'',
                name:'',
                username:'',
                id:'',
                avatar:''
            }
            state.userInfo = userDefault
            setInfo(userDefault)
        }
    },
    actions:{ //处理异步

    },
    getters:{}
}